package com.itheima.hotel.service.login;

import com.itheima.hotel.service.UserLogin;

import java.util.Scanner;

public class UserLoginImpl implements UserLogin {

    @Override
    public boolean login() {
        Scanner scanner = new Scanner(System.in);
        final String userName = "user";
        final String userWord = "123456";
        System.out.println("请输入用户名");
        String passName = scanner.next();
        if (userName.equals(passName)) {
            System.out.println("请输入密码");
            String passWord = scanner.next();
            if (userWord.equals(passWord)) {
                return true;
            } else {
                System.out.println("密码错误");
            }
        } else {
            System.out.println("用户名错误");
        }

        return false;
    }


}
